package com.nbsaas.boot.project.rest.resource;

import com.nbsaas.boot.project.api.apis.ProjectAppApi;
import com.nbsaas.boot.project.data.entity.ProjectApp;
import com.nbsaas.boot.project.api.domain.request.ProjectAppRequest;
import com.nbsaas.boot.project.api.domain.response.ProjectAppResponse;
import com.nbsaas.boot.project.api.domain.simple.ProjectAppSimple;
import com.nbsaas.boot.project.rest.convert.ProjectAppSimpleConvert;
import com.nbsaas.boot.project.rest.convert.ProjectAppEntityConvert;
import com.nbsaas.boot.project.rest.convert.ProjectAppResponseConvert;
import com.nbsaas.boot.project.data.repository.ProjectAppRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   业务接口实现
*/
@Transactional
@Service
public class ProjectAppResource extends BaseResource<ProjectApp,ProjectAppResponse, ProjectAppSimple, ProjectAppRequest>  implements ProjectAppApi {

    @Resource
    private ProjectAppRepository projectAppRepository;

    @Override
    public JpaRepositoryImplementation<ProjectApp, Serializable> getJpaRepository() {
        return projectAppRepository;
    }

    @Override
    public Function<ProjectApp, ProjectAppSimple> getConvertSimple() {
        return new ProjectAppSimpleConvert();
    }

    @Override
    public Function<ProjectAppRequest, ProjectApp> getConvertForm() {
        return new ProjectAppEntityConvert();
    }

    @Override
    public Function<ProjectApp, ProjectAppResponse> getConvertResponse() {
        return new ProjectAppResponseConvert();
    }




}


